home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_opentomb.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  124 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # PRU_opentomb.cog
  5. #
  6. # Simple Door/Lever Script
  7. #
  8. # [RKD] [TL] [RT] [GGJ]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12. symbols
  13.     
  14. message    startup
  15. message    activated    
  16. message    arrived     
  17. message    crossed
  18.  
  19. thing    door0
  20. thing    lever
  21. thing   player            local
  22. thing   indy              nolink
  23. thing   camera
  24. thing    ghost
  25.     
  26. keyframe    in_pull=in_pull_lever_down.key    local
  27. keyframe    lever_down=gen_lever.key           local
  28.     
  29. sound    startdoor
  30. sound    movedoor
  31. sound    stopdoor
  32. sound    leversound
  33. sound    leversound2
  34. sound    openwav   
  35.  
  36. int      open=0               local
  37. int      curCam            local
  38. int      move0channel      local
  39. int      move1channel      local   
  40. int      begun=0           local
  41. int      hintgone=0        local
  42.     
  43. flex        moveSpeed=1.0
  44.  
  45. end
  46.  
  47. # ========================================================================================
  48.  
  49. code
  50.  
  51. startup:
  52.  
  53.    player = GetLocalPlayerThing();
  54.    //SetFaceGeoMode(mapadjoin, 0);
  55.    //SetSectorAdjoins(mapsector, 0);
  56.    return;
  57. # ========================================================================================
  58. activated:
  59.    
  60.    if ((begun) == 1) return;
  61.    
  62.    
  63.    if (GetSenderRef() == lever)
  64.       {
  65.          StartCutscene(1);
  66.          begun = 1;
  67.          curCam = GetCurrentCamera();
  68.          SetThingFlags(player, 0x80000);
  69.          ClearThingFlags(indy, 0x80000);
  70.          SetCameraFocus(2, camera);
  71.          SetCameraLookInterp(2, 0);
  72.          SetCameraPosInterp(2, 0);
  73.          Sleep(0.1);
  74.          SetCameraSecondaryFocus(2, indy);
  75.          SetCurrentCamera(2);
  76.          PlayKey(lever, lever_down, 4, 0x12, 0);
  77.          PlayKey(indy, in_pull, 4, 0x12, 0);
  78.          Sleep(1.2);   
  79.          PlaySoundLocal(leversound, 1.0, 0, 0x0000, 0);
  80.          Sleep(1.4);
  81.          PlaySoundLocal(leversound2, 1.0, 0, 0x0000, 0);
  82.          Sleep(0.3);
  83.          //if (open == 0) 
  84.          //{
  85.             SetCameraLookInterp(2, 1);
  86.             SetCameraPosInterp(2, 1);
  87.             SetCameraInterpSpeed(2, 1.0);
  88.             Sleep(0.1);
  89.             SetCameraSecondaryFocus(2, ghost);
  90.             PlaySoundLocal(startdoor, 1.0, 0, 0x0000, 0);
  91.             move0channel = PlaySoundLocal(movedoor, 1.0, 0, 0x0001, 0);
  92.             MoveToFrame(door0, 1 - GetCurFrame(door0), moveSpeed);
  93.             MoveToFrame(camera, 1, 3.0);
  94.             PlaySoundLocal(openwav, 1.0, 0, 0x0000, 0);
  95.             
  96.          //}
  97.  
  98.          EndCutscene();
  99.       }
  100.    return;
  101.  
  102. # ........................................................................................
  103. arrived:    
  104.       
  105.    if (GetSenderRef() != door0) return;
  106.  
  107.     StopSound(move0channel, 0.0);
  108.     StopSound(move1channel, 0.0);
  109.     PlaySoundLocal(stopdoor, 1.0, 0, 0x0000, 1);
  110.     //open = 1 - open;
  111.     SetCurrentCamera(curCam);
  112.     #SetCameraFocus(curCam, player);
  113.     SetThingFlags(indy, 0x80000);
  114.     ClearThingFlags(player, 0x80000);
  115.     begun = 0;
  116.     
  117.    return;
  118.  
  119. # ........................................................................................
  120.  
  121.  
  122. end
  123.  
  124.